<template>
  <el-container>
    <el-header>
      <!-- 头部区 -->
      <img src="../assets/images/logo.png" alt="" />
      <el-menu
        mode="horizontal"
        background-color="#23262e"
        text-color="#fff"
        active-text-color="rgb(64, 158, 255)"
      >
        <el-submenu index="bbb">
          <template slot="title">
            <img class="avatar" src="../assets/logo.png" alt="" />
            个人中心
          </template>
          <el-menu-item index="b1">用户资料</el-menu-item>
          <el-menu-item index="b2">重置密码</el-menu-item>
          <el-menu-item index="b2">更换头像</el-menu-item>
        </el-submenu>
        <el-menu-item index="aaa">退出</el-menu-item>
      </el-menu>
    </el-header>
    <el-container>
      <!-- 侧边栏 -->
      <el-aside width="200px">
        <div class="user-info">
          <img class="avatar" src="@/assets/logo.png" alt="" />
          <p>欢迎你， <span>哈哈哈</span></p>
        </div>
        <el-menu
          mode="vertical"
          background-color="#23262e"
          text-color="#fff"
          active-text-color="rgb(64, 158, 255)"
          default-active="aaa"
          unique-opened
        >
          <el-menu-item index="aaa">首页</el-menu-item>
          <el-submenu index="bbb">
            <template slot="title">文章管理</template>
            <el-menu-item index="b1">类别管理</el-menu-item>
            <el-menu-item index="b2">文章管理</el-menu-item>
          </el-submenu>
          <el-submenu index="ccc">
            <template slot="title">个人中心</template>
            <el-menu-item index="c1">重置密码</el-menu-item>
            <el-menu-item index="c2">更换头像</el-menu-item>
            <el-menu-item index="c2">用户资料</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>
    </el-container>
  </el-container>
</template>

<script>
export default {
  name: 'MyHome'
}
</script>

<style lang="less" scoped>
// 头部
.el-header {
  background-color: #23262e;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.avatar {
  height: 35px;
  width: 35px;
  border-radius: 50%;
  // 下面的样式是，让图片按照原比例，完整的展示
  object-fit: cover;
  background-color: #fff;
  margin-right: 10px;
}

// 侧边栏
.el-aside {
  background-color: #23262e;
  height: 100%;
  .el-menu {
    width: 200px;
    overflow: hidden;
  }
}

.el-menu-item {
  font-size: 13px;
}
.el-submenu {
  /deep/ .el-submenu__title {
    font-size: 13px;
  }
}

// 内容区
.el-main {
  background-color: #f2f2f2;
}

.el-container {
  height: 100%;
}
.user-info {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 70px;
  p {
    color: #fff;
    font-size: 13px;
  }
}
</style>
